//
//  YWEquipmentFieldRecord.m
//  maintain
//
//  Created by Kyo on 16/4/7.
//  Copyright © 2016年 ewin. All rights reserved.
//

#import "YWEquipmentFieldRecord.h"
#import "YWEquipmentType.h"
#import "MJExtension.h"

@implementation YWEquipmentFieldRecord

+ (NSDictionary *)mj_objectClassInArray{
    return @{@"options" : @"YWEquipmentFieldOption"};
}

- (void)mj_keyValuesDidFinishConvertingToObject{
    if (self.options.count) {
        self.fieldTypeId = YWEquipmentFieldTypeIdDownSelect;
        [self.options enumerateObjectsUsingBlock:^(YWEquipmentFieldOption*  _Nonnull fieldOption, NSUInteger idx, BOOL * _Nonnull stop) {
            if (fieldOption.fieldOptionId == [_fieldValue integerValue]) {
                self.fieldOption = fieldOption;
                *stop = YES;
            }
        }];
    }
}

@end
